<script setup>
import {getDataList} from './lib/user.js'
import {ref} from 'vue'

const state = ref({
  loading: false,
  dataList: []
})

const get = ()=>{
  getDataList(state.value,'/list',{params:{id:1,name:'lisi'}})
}

</script>
<template>
  <el-button size="small" type="success" @click="getDataList(state,'/list',{params:{id:1,name:'lisi'}})">show list user</el-button>
  <el-button size="small" type="success" @click="get">show list user</el-button>
  <hr>
  <el-table empty-text="请点击加载数据" v-loading="state.loading" :data="state.dataList" border stripe>
    <el-table-column prop="name" label="姓名"/>
    <el-table-column prop="birthday" label="出生日期"/>
  </el-table>
</template>
